//
//  MaterListTableCell.m
//  DaleTou
//
//  Created by  on 2018/5/28.
//  Copyright © 2018年 geren. All rights reserved.
//

#import "MaterListTableCell.h"

@implementation MaterListTableCell

+ (instancetype )defaultClassNameNibView
{
    NSString *className = NSStringFromClass([self class]);
    NSArray *views = [[UINib nibWithNibName:className bundle:nil] instantiateWithOwner:nil options:nil];
    
    for (UIView *custom in views) {
        if ([custom isMemberOfClass:[self class]]) {
            return custom;
        }
    }
    NSAssert(NO, @"Expect file: %@", [NSString stringWithFormat:@"%@.xib", NSStringFromClass([self class])]);
    return nil;
}

- (void)setModel:(MasterModel *)model {
    _model = model;
    self.name.text = model.name;
    self.lookCount.text = model.lookCount;
    self.CorrectNum.text = model.CorrectNum;
    self.theMax.text = [NSString stringWithFormat:@"最大连中%@期",model.theMax];
    self.avatar.image = [UIImage imageNamed:model.image];
    self.ranking.hidden = NO;
    if (self.index == 0) {
        self.ranking.image = [UIImage imageNamed:@"NO1"];
    } else if (self.index == 1) {
        self.ranking.image = [UIImage imageNamed:@"NO2"];
    } else if (self.index == 2) {
        self.ranking.image = [UIImage imageNamed:@"NO3"];
    } else {
        self.ranking.hidden = YES;
    }
}

@end
